#include <iostream>
#include <map>

int main() {
    // 创建一个map容器来存储键值对
    std::map<std::string, int> myMap;

    // 向容器中添加元素
    myMap["apple"] = 1;
    myMap["banana"] = 2;
    myMap["orange"] = 3;

    // 查找并输出元素
    std::cout << "The value of apple is: " << myMap["apple"] << std::endl;

    // 遍历容器中的元素并输出
    std::cout << "All elements in the container: ";
    for (auto &x: myMap) {
        std::cout << x.first << ":" << x.second << " ";
    }
    std::cout << std::endl;

    return 0;
}